package com.sophic_tech.hkb

import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.asFlow
import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.launch
import org.springframework.stereotype.Component

@Component
class Test {

    val coroutineScope = CoroutineScope(Dispatchers.Default)
    fun test() {
        coroutineScope.launch {
            (1..10).asFlow().flowOn(Dispatchers.IO).collect {
                delay(1000)
                println(it)
            }
        }
    }

}

//fun main() {
//    val username = String.randomUsername()
//    println(username)
//}